// import { kebabCase } from "./string"
import { ComponentResolveResult } from "unplugin-vue-components"

// const withStyles = ["CollapsibleForm", "FormItem", "Tabs"]

export function PurchasingComponentsResolver() {
  return (name: string): ComponentResolveResult => {
    if (name.startsWith("Pc")) {
      const componentName = name.slice(2)
      // const dirName = kebabCase(componentName)
      // const cssPath = `@purchasing/components/${dirName}/${componentName}.css`

      return {
        name: componentName,
        from: "@purchasing/components",
        // sideEffects: withStyles.includes(componentName) ? cssPath : undefined,
      }
    }
  }
}

export default PurchasingComponentsResolver
